set -xe
# build glad as shared lib
gcc -fPIC -shared vendor/glad/src/glad.c -o lib/libglad.so

# build runara as shared lib
gcc -fPIC -shared runara.c `pkg-config --cflags --libs freetype2` -I vendor/glad/include/ -I vendor/linesky/ -march=native -ffast-math -o lib/librunara.so

# build simple.c
# gcc simple.c -lglfw -L lib/ -l:librunara.a  -I vendor/glad/include/ -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lharfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -lfreetype  -I include/runara/ -lm -l glad
gcc simple.c -lglfw -L lib/ -l runara  -I vendor/glad/include/ -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lharfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -lfreetype  -I include/runara/ -lm -l glad